<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<title>angular</title>
</head>
<body>
<style type="text/css" media="screen">
	*{margin: 0;padding: 0;}
	li{list-style: none;width: 25%;float: left;text-align: center;font-size: 18px;}
	
</style>
<div ng-app="myApp">
	<header>导航部分</header>
	<div ui-view></div>
	<footer>底部</footer>
</div>

<script type="text/javascript">
	document.getElementsByTagName('html')[0].style.fontSize=window.screen.width/10+'px';
</script>
<script src="angular.min.js"></script>
<script src="angular-ui-router.js"></script>
<script type="text/javascript">
	var app =angular.module('myApp', ['ui.router']);
	app.config(function($stateProvider) {
		console.log($stateProvider)
		$stateProvider
			.state('home',{
				url:'/',
				template:'<h1>hello</h1>'
			})
			.state('movie',{
				// url:'/movie/{id:string}',
				// url:'/movie?before&after',
				// url:'/movie?{before:data}&{after:data}',
				templateUrl:'demo2.html',
				// controller:function($scope){
				// 	$scope.movie='星际迷航';
				// }
				controller:'movieCtrl'
			})
	})
	app.controller('movieCtrl', function($scope,$stateParams){
		console.log($stateParams);
		$scope.movie='星际迷航2';
		$scope.idIs=$stateParams.id;
		$stateParams.id='cba';
		console.log('id:'+$stateParams.id)
	})
</script>
</body>
</html>
<!--应该是14.11，时间-2017-05-08->